/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.subsystems;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Relay;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
import edu.wpi.first.wpilibj.templates.RobotMap;
/**
 *
 * @author Conor
 * I will try to document this to the best of my abilities.
 */
        
public class CompressorSystem extends Subsystem {
    
    //methods for controlling subsystem
    //call from the commands.
    
    private Compressor compressor;
    
    private Relay relay;
    
    public static Solenoid SolenoidControl;
    
    public CompressorSystem() {
        
        compressor = new Compressor(RobotMap.PRESSURE_CHANNEL, RobotMap.COMPRESSOR_RELAY);
        SolenoidControl = new Solenoid(RobotMap.PISTON_SOLENOID);       
    } 

    public boolean isMaxPSI(){
        return compressor.getPressureSwitchValue();
    }
    
    public void runCompressor(){
        compressor.start();
    }
    
    public void stopCompressor(){
        compressor.stop();
    }
    
    protected void initDefaultCommand() {
    }
    
    public void lowerBridgeArm(){
        SolenoidControl.set(true);
        
        SmartDashboard.putBoolean("Bridge Arm Down", true); 
    }
    
    public void raiseBridgeArm(){
        SolenoidControl.set(false);
        
        SmartDashboard.putBoolean("Bridge Arm Up", true);
    }
  
    public boolean isSolenoidControl(){
        return SolenoidControl.get();
    }
}

            
            
            
    

